package br.com.treinar.modelo.principal;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import br.com.treinar.modelo.Contato;
import br.com.treinar.modelo.ContatoTelefone;

public class TesteCarga {

	public static void main(String[] args) {
		EntityManagerFactory factory = Persistence.createEntityManagerFactory("treinar_modelo");
		EntityManager manager = factory.createEntityManager();
		
		Contato c = manager.find(Contato.class, 3l);
		for (ContatoTelefone ct : c.getTelefones()) {
			System.out.println(ct.getTelefone().getNumero());
		}
		System.out.println(c);
	}
	
}
